<h1 class="body-box-title">Edit article</h1>
<p>Hi <strong><?php echo $this->user->userNick; ?></strong>! You have writed <strong><?php echo $this->user->userArticles; ?></strong> articles. good baby!</p>
<form action="<?php echo $this->url(array('action' => 'added', 'controller' => 'article', 'module' => 'home'), null, true); ?>" method="post" id="edit-article-form">
<input type="hidden" name="article_id" id="the-article-id" value="<?php echo $this->articleID; ?>" />
<div class="edit-article-box">
	<div class="edit-article-slider fr">
		<div class="edit-article-slider-box">
			<div class="article-status-box">
				Status:<span class="article-status-editing">编辑中... 上次保存在<label></label></span><span class="article-status-saving"><label>自动保存草稿中...</label></span>
			</div>
			<div class="article-status-box">
				Article Version:<span class="article-status-number" id="article-version-value"><?php echo @(int)$this->article['articleVersion']; ?></span> Autosaved:<span class="article-status-number" id="article-autosaved-count">0</span>
			</div>
			<div class="article-status-box">
				<input type="submit" id="submit-article" name="<?php echo $this->url(array('action' => 'rough', 'controller' => 'article', 'module' => 'home'), null, true); ?>" value="发布文章" />
			</div>
		</div>
		<div class="edit-article-slider-box">
			<fieldset>
				<legend>Tags</legend>
				<div>
					<input type="text" id="add-tag-input" name="tag" size="20" class="tag-input" />
					<input type="button" id="add-tag-botton" name="add-tag" value="Add" />
					<label class="new-tag-desc">多个tag请用空格 " " 或在逗号 "," 隔开.</label>
				</div>
				<div class="nd" id="old-tag-tpl">
					<span class="tag-item" name="tpltag">
						<input class="nd" type="checkbox" name="tags[]" value="" />
						<a href="#" class="del-tag-link">
							<img alt="delete" src="/images/delitem.gif" width="12" height="12" border="0" align="bottom" />
						</a>
						<label>test</label>
					</span>
				</div>
				<div class="added-tags" id="added-tags-box"></div>
			</fieldset>
		</div>
		<div class="edit-article-slider-box">
			<fieldset id="article-category-box">
				<legend>Categories</legend>
				<?php if(isset($this->article['categories'])) { foreach ($this->article['categories'] as $c) { ?>
				<div class="category-checkbox-row">
					<input type="checkbox" class="article-category-checkbox" id="category-checkbox-<?php echo $c['categoryID']; ?>" value="<?php echo $c['categoryID']; ?>" name="categories[]" <?php
					if (isset($this->article['articleCategory']) && array_key_exists($c['categoryID'], $this->article['articleCategory'])) {
						echo 'checked="checked"';
					}
					?> />
					<label for="category-checkbox-<?php echo $c['categoryID']; ?>"><?php echo $c['categoryName']; ?>(<?php echo $c['categoryCounts']; ?>)</label>
				</div>
				<?php } } ?>
			</fieldset>
		</div>
	</div>
	<div class="edit-article-main">
		<div class="edit-article-info nd">Article has been saved success! <a id="saved-article-view-link" href="javascript:;" target="_blank">You can click here view this article</a></div>
		<div class="edit-article-title">
			<input type="text" name="title" id="edit-article-title-input" class="article-title-input" value="<?php echo $this->article['articleTitle']; ?>" />
		</div>
		<div class="edit-article-media">Add media to this article from: <a href="#">Photos</a><a href="#">Attachments</a></div>
		<div class="edit-article-content">
			<textarea id="editor" rows="10" cols="80"></textarea>
		</div>
	</div>
	<div class="cr"></div>
</div>
</form>